<include file="Layout/header" />
<body>
<div class="breadcrumbs" id="breadcrumbs"> 
  <script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>
  <ul class="breadcrumb">
    <li> <i class="icon-home home-icon"></i> <a href="{:U('Admin/Index/welcome')}">首页</a> </li>
    <li class="active">文章列表</li>
  </ul>
</div>
<div class="page-content">
  <div class="page-header">
    <h1> 文章列表 <small> <i class="icon-double-angle-right"></i> 文章列表 </small> </h1>
  </div>
  <div class="row">
    <form method="get" action="{:U('Admin/Rule/admin_log')}">
      <table class="table table-striped table-bordered table-hover table-condensed">
        <tr>
           <td width="15%"><input class="col-xs-12 col-sm-8" type="text" name="admin_name" value="<?php echo $_GET['admin_name'];?>" placeholder="操作人"></td>
           <th width="30%"> 
            <div class="col-xs-3">
              <div class="input-group input-group-sm">
                <input id="datepicker" class="form-control hasDatepicker" name="time_from" value="<?php echo $_GET['time_from'];?>" type="text">
                <span class="input-group-addon"> <i class="icon-calendar"></i> </span> </div>
             </div>
             <div class="col-xs-1" style="padding: 5px 18px;">至</div>
             <div class="col-xs-3">
              <div class="input-group input-group-sm">
                <input id="datepicker1" class="form-control hasDatepicker" name="time_to" value="<?php echo $_GET['time_to'];?>"  type="text">
                <span class="input-group-addon"> <i class="icon-calendar"></i> </span> </div>
             </div> 
           
          </th>
          <td width="20%"><input class="btn btn-success" type="submit" value="搜索"></td>
        </tr>
      </table>
    </form>
    <div class="col-xs-12">
       <div class="table-responsive">
        <table id="sample-table-1" class="table table-striped table-bordered table-hover">
          <thead>
            <tr>
              <th class="center"> <label>
                  <input class="ace" type="checkbox">
                  <span class="lbl"></span> </label>
              </th>
              <th>ID</th>
              <th>内容</th>
              <th class="hidden-480">用户名</th>
              <th>客户端IP </th>
              <th class="hidden-480">时间</th>
             </tr>
          </thead>
          <tbody>
          <form method="post" action="detadel" id="ondel">
            <foreach name="list.data" item="val">
              <tr class="selected">
                <td class="center"><label>
                    <input class="ace" type="checkbox" value="{$val.id}" name="article_id[]">
                    <span class="lbl"></span> </label></td>
                <td>{$val.id}</td>
                <td>{$val.content}</td>
                <td class="hidden-480">{$val.admin_name}</td>
                <td>{$val.ip}</td>
                <td class="hidden-480"><?php echo date('Y-m-d H:i:s',$val['createtime']); ?></td>
                 
              </tr>
            </foreach>
          </form>
            </tbody>
          
        </table>
        <div>
          <button class="btn btn-danger" onClick="datadel()">批量删除</button>
        </div>
      </div>
      
      <!-- /.table-responsive --> 
    </div>
    <div >{$list.page}</div>
  </div>
</div>
<include file="Layout/js"/> 
<link href="__ADMIN_CSS__/datepicker.css" rel="stylesheet" />
<script src="__ADMIN_JS__/date-time/bootstrap-datepicker.min.js"></script>
<script src="__ADMIN_JS__/jquery.ui.touch-punch.min.js"></script>
<script src="__ADMIN_JS__/jquery.dataTables.min.js"></script> 
<script src="__ADMIN_JS__/jquery.dataTables.bootstrap.js"></script> 
<script src="__ADMIN_JS__/bootbox.js"></script> 
<script type="text/javascript">
			jQuery(function($) {
				$("#datepicker").datepicker({
					showOtherMonths: true,
					selectOtherMonths: false,
					 
				});
				 
				$("#datepicker1").datepicker({
					showOtherMonths: true,
					selectOtherMonths: false,
					 
				}); 
				
				var oTable1 = $('#sample-table-2').dataTable( {
				"aoColumns": [
			      { "bSortable": false },
			      null, null,null, null, null,
				  { "bSortable": false }
				] } );
				
				
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});
			
  				
			})
 		</script> 
<script type="text/javascript">       
 
/*批量-删除*/
function datadel(){
	 var is_check=$("input[type='checkbox']").is(':checked');
   if(is_check){
	    bootbox.setLocale("zh_CN");  
      bootbox.confirm("确定删除日志记录?", function(result) {  
        if (result) {  
           $("#ondel").submit();
         }  
      }); 
    }else{
      bootbox.alert({  
            buttons: {  
               ok: {  
                    label: '返回',  
                    className: 'btn-myStyle'  
                }  
            },  
            message: '请选择要删除的记录',  
            callback: function() {  
               // alert('关闭了alert');  
            },  
            title: "提示信息",  
        });
    } 
	 
	
}
 </script>
</body>
</html>